#include "Library.h"

HMODULE CLibrary::s_hMod = NULL;

bool CLibrary::Load(_STRING strPathName)
{
	GAF_CHECK_R(s_hMod == NULL, false);

	s_hMod = LoadLibrary(strPathName.c_str());

	return s_hMod != NULL;
}

bool CLibrary::Unload()
{
	GAF_CHECK_R(s_hMod != NULL, false);

	FreeLibrary(s_hMod);

	return true;
}

FARPROC CLibrary::GetFunc(_STRING strFuncName)
{
	GAF_CHECK_R(s_hMod != NULL, NULL);

	return GetProcAddress(s_hMod, strFuncName.c_str());
}